package com.atguigu.tingshu.album.mapper;

import com.atguigu.tingshu.model.album.TrackInfo;
import com.atguigu.tingshu.query.album.TrackInfoQuery;
import com.atguigu.tingshu.vo.album.AlbumTrackListVo;
import com.atguigu.tingshu.vo.album.TrackListVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface TrackInfoMapper extends BaseMapper<TrackInfo> {
    IPage<TrackListVo> selectUserTrackPage(Page<TrackListVo> page, @Param("trackInfoQuery") TrackInfoQuery trackInfoQuery);

    /**
     * 根据专辑id查询专辑声音分页列表
     * @param albumTrackListVoPage
     * @param albumId
     * @return
     */
    IPage<AlbumTrackListVo> findAlbumTrackPage(Page<AlbumTrackListVo> albumTrackListVoPage, @Param("albumId") Long albumId);

    /**
     * 更新声音统计信息
     * @param trackId
     * @param count
     * @param statType
     */
    void updateTrackStat(@Param("trackId") Long trackId, @Param("count")Integer count, @Param("statType")String statType);
}
